package com.zzy.ecommerce.service.impl;

import com.zzy.ecommerce.dao.TAccountMapper;
import com.zzy.ecommerce.dao.TOrderMapper;
import com.zzy.ecommerce.domain.Order;
import com.zzy.ecommerce.domain.TOrder;
import com.zzy.ecommerce.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class OrderServiceImpl implements OrderService {
    @Autowired
    private TOrderMapper tOrderMapper;
    @Override
    public List<Order> selectAllOrder() {
        return tOrderMapper.selectAllOrder();
    }

    @Override
    public TOrder selectOneOrder(Integer id) {
        return tOrderMapper.selectOneOrder(id);
    }

    @Override
    public Integer deleteOneOrder(Integer id) {
        return tOrderMapper.deleteOneOrder(id);
    }

    @Override
    public Integer deleteAllOrders() {
        return tOrderMapper.deleteAllOrders();
    }

    @Override
    public Integer insertOneOrder(TOrder tOrder) {
        return tOrderMapper.insertOneOrder(tOrder);
    }

    @Override
    public List<TOrder> selectAllUserOrder(Integer id) {
        return tOrderMapper.selectAllUserOrder(id);
    }

    @Override
    public Double selectOneUserAllOrderPrice(Integer id) {
        return tOrderMapper.selectOneUserAllOrderPrice(id);
    }

    @Override
    public TOrder selectOneOrderById(Integer id) {
        return tOrderMapper.selectOneOrderById(id);
    }

}
